<template>
  <div class="step-indicator">
    <div class="step" :class="{active: currentStep === 1, completed: currentStep > 1}">
      <div class="step-circle">1</div>
      <div class="step-text">基本信息</div>
    </div>
    <div class="step" :class="{active: currentStep === 2, completed: currentStep > 2}">
      <div class="step-circle">2</div>
      <div class="step-text">一级科室</div>
    </div>
    <div class="step" :class="{active: currentStep === 3, completed: currentStep > 3}">
      <div class="step-circle">3</div>
      <div class="step-text">二级科室</div>
    </div>
    <div class="step" :class="{active: currentStep === 4, completed: currentStep > 4}">
      <div class="step-circle">4</div>
      <div class="step-text">选择医生</div>
    </div>
    <div class="step" :class="{active: currentStep === 5, completed: currentStep > 5}">
      <div class="step-circle">5</div>
      <div class="step-text">预约时间</div>
    </div>
    <div class="step" :class="{active: currentStep === 6}">
      <div class="step-circle">6</div>
      <div class="step-text">确认提交</div>
    </div>
  </div>
</template>

<script setup>
defineProps({
  currentStep: {
    type: Number,
    required: true
  }
})
</script>

<style scoped>
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
  position: relative;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  height: 4px;
  background-color: #e0e0e0;
  z-index: 1;
}

.step {
  text-align: center;
  z-index: 2;
  background-color: white;
  padding: 0 15px;
  flex: 1;
}

.step-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #e0e0e0;
  color: #777;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-weight: bold;
  font-size: 24px;
  transition: all 0.3s ease;
  border: 4px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.step.active .step-circle {
  background-color: #3498db;
  color: white;
  transform: scale(1.1);
}

.step.completed .step-circle {
  background-color: #2ecc71;
  color: white;
}

.step-text {
  font-size: 18px;
  font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .step-indicator {
    flex-wrap: wrap;
  }

  .step {
    margin-bottom: 15px;
    flex: 0 0 33.33%;
  }

  .step-circle {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .step-text {
    font-size: 16px;
  }
}
</style>